//
//  Disk.hpp
//  RayTracer
//
//  Created by 俞云康 on 3/25/16.
//  Copyright © 2016 yushroom. All rights reserved.
//

#ifndef Disk_hpp
#define Disk_hpp

#include "Shape.hpp"

// default normal is (0, 0, 1)
class Disk : public Shape {
public:
    float3 position;
    float D;    // D in plane equation
    float3 normal;  // also (A, B, C) in plane equation
    float radius;
    float radius_squared;
    
    Disk(const string& name,
         const float radius,
         const std::shared_ptr<Transform>& transform);
    
    virtual bool intersect(const Ray& r, HitInfo* hit) const override;
    
    virtual bool intersect(const Ray& r) const override;
    
    virtual float area() const override;
    
    virtual Position sample(const Sample& sample, Normal* shape_normal) const override;
};

#endif /* Disk_hpp */
